package com.shop.controller;

import com.shop.commom.utils.JSONResult;
import com.shop.vo.ShopCartBo;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

@RestController
@RequestMapping("shopcart")
public class ShoppingCartController {



    @PostMapping("/add")
    public JSONResult index(@RequestParam String userId, @RequestBody ShopCartBo shopCartBo,
                            HttpServletRequest servletRequest, HttpServletResponse response){
        // todo 保存到redis
        System.out.println(shopCartBo);
        return JSONResult.OK();
    }

    @PostMapping("/del")
    public JSONResult del(@RequestParam String userId, @RequestParam String itemSpecId,
                            HttpServletRequest servletRequest, HttpServletResponse response){
        // todo 删除redis中的数据
        System.out.println(itemSpecId);
        return JSONResult.OK();
    }



}
